home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / front.lha / front / m2c / Path.c < prev    next >
C/C++ Source or Header  |  1992-08-18  |  981b  |  62 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_Strings
  4. #include "Strings.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_System
  8. #include "System.h"
  9. #endif
  10.  
  11. #ifndef DEFINITION_Path
  12. #include "Path.h"
  13. #endif
  14.  
  15.  
  16. struct S_2 {
  17.     CHAR A[255 + 1];
  18. };
  19.  
  20.  
  21. void Path_InsertPath
  22. # ifdef __STDC__
  23. (CHAR a[], LONGCARD O_1)
  24. # else
  25. (a, O_1)
  26. CHAR a[];
  27. LONGCARD O_1;
  28. # endif
  29. {
  30.   Strings_tString s1, s2;
  31.   Strings_tString l;
  32.   struct S_2 Arg;
  33.   Strings_tStringIndex pos;
  34.  
  35.   GetArgument(0L, Arg.A, 256L);
  36.   Strings_ArrayToString(Arg.A, 256L, &s1);
  37.   pos = Strings_Length(&s1);
  38.   while (pos > 0 && Strings_Char(&s1, pos) != '/') {
  39.     DEC(pos);
  40.   }
  41.   if (pos > 0) {
  42.     Strings_SubString(&s1, 1, pos, &s2);
  43.     Strings_ArrayToString(a, O_1, &s1);
  44.     Strings_Concatenate(&s2, &s1);
  45.     Strings_Append(&s2, '\0');
  46.     Strings_StringToArray(&s2, a, O_1);
  47.   }
  48. }
  49.  
  50. void BEGIN_Path()
  51. {
  52.   static BOOLEAN has_been_called = FALSE;
  53.  
  54.   if (!has_been_called) {
  55.     has_been_called = TRUE;
  56.  
  57.     BEGIN_Strings();
  58.     BEGIN_System();
  59.  
  60.   }
  61. }
  62.